package com.demo.bookstore.dao.impl;

import com.demo.bookstore.bean.BookOrderItem;
import com.demo.bookstore.dao.OrderItemDao;

/**
 * @author ddone
 * @date 2024/3/17-11:54
 */
public class OrderItemDaoImpl extends BaseDaoImpl implements OrderItemDao {
    @Override
    public void addOrderItem(BookOrderItem bookOrderItem) {
        String sql = "insert into book_order_item(book_name,price,img_path,item_count,item_amount,order_id,create_time)" +
                " values(?,?,?,?,?,?,?)";
        this.update(sql,bookOrderItem.getBookName(),bookOrderItem.getPrice(),bookOrderItem.getImgPath(),
                bookOrderItem.getItemCount(),bookOrderItem.getItemAmount(),bookOrderItem.getOrderId(),
                bookOrderItem.getCreateTime()
                );
    }
}
